fix(logging): handle WebSocketResponsesRequest in convertToProcessedStreamResponse#3019
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Superseded by #3018 (merged 2026-04-24), which bundles the fix for this issue and several other native WS reliability bugs. Closing this draft as redundant. |
Summary
convertToProcessedStreamResponseinplugins/logging/utils.gohas a switch onrequestTypethat covers six request types but is missing a case forschemas.WebSocketResponsesRequest. Requests routed through the native-WS Responses path fall through todefaultand get stored understreaming.StreamTypeChatinstead ofstreaming.StreamTypeResponses. This mis-labels the accumulated chunk data in the log store, causing downstream consumers that branch on stream type to receive incorrectly shaped content for WebSocket Responses streams.Root cause:
schemas.WebSocketResponsesRequestwas added after the switch was written and the case was never added.Changes
plugins/logging/utils.go: extend theResponsesStreamRequestcase to also matchschemas.WebSocketResponsesRequest, routing it tostreaming.StreamTypeResponses.plugins/logging/utils_test.go: add five unit tests covering the new case, a regression guard for the existingResponsesStreamRequestarm, a parity assertion between both types, nil-input safety, and the default fallback.Type of change
Affected areas
How to test
go build ./plugins/logging/... go test ./plugins/logging/... -cover -run TestConvertToProcessed go vet ./plugins/logging/...Expected: all five
TestConvertToProcessed*tests pass.WebSocketResponsesRequestandResponsesStreamRequestboth resolve tostreaming.StreamTypeResponses.Runtime validation requires #2997 and #2999 to land first (those PRs restore the WS log row write path on main). Once they are in, the steps from the issue reproduce the correct
stream_type = responsesin the stored row.Screenshots/Recordings
N/A (logging internals, no UI change)
Breaking changes
Related issues
Closes #3000
Related: #2997 and #2999 are prerequisites for runtime observation of this defect (they restore the WS log row write path on main). This bug was discovered while working on PR #2775 in thiscantbeserious/bifrost. That branch contains the fix extracted here as a side effect of the feature work.
Security considerations
None. This change only affects how an existing log accumulation result is categorised by stream type.
Checklist
docs/contributing/README.mdand followed the guidelines